<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/12/8
 * Time: 10:32
 */

include "config.php";

if(isset($_REQUEST["id"])&&isset($_REQUEST["num"])){
    $CID=$_REQUEST["id"];
    $CNUM=$_REQUEST["num"];
    $sql="UPDATE cart SET c_num=? WHERE c_id=?";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("ii",$CNUM,$CID);
    $stmt->execute();
    //print_r($stmt);
    if($stmt->affected_rows>=1){
        print_r(json_encode(array("status"=>1,"msg"=>"修改成功")));
    }else{
        print_r(json_encode(array("status"=>-1,"msg"=>"修改失败")));
    }
    
}


